﻿@model Freshome.p.Models.Seekeeps
@{
    ViewBag.Title = Model.Neword + " | 搜索 | 食锦";
}
<script src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
<div id="recipes">
    <h1>
        <span>
            @if (!string.IsNullOrEmpty(Model.Majoraw_nm))
            {
                @Model.Majoraw_nm 
            }
            else if (!string.IsNullOrEmpty(Model.Minoraw_nm))
            {
                @Model.Minoraw_nm
            }
            else
            {
                @Model.Neword
            }
            ：<strong>@Model.Rps.Count()</strong> 道家常美食！</span>
    </h1>
    @foreach (var rp in Model.Rps)
    {
        <div class="boxed halfill">
            @{ Html.RenderPartial("Recipeer", rp); }
        </div>
    }
    @if (!string.IsNullOrEmpty(Model.Majoraw_nt))
    {
        <div class="boxed">
            <h3>@Model.Minoraw_nm</h3>
            <div>@Model.Majoraw_nt</div>
        </div>
        @Html.Action("Pairawords", "Home", new { id = Model.Majoraw_id })
    }
    @if (!string.IsNullOrEmpty(Model.Minoraw_nt))
    {
        <div class="boxed">
            <h3>@Model.Minoraw_nm</h3>
            <div>@Model.Minoraw_nt</div>
        </div>
    }
</div>
@section asidetail
{
    @if (Model.Mjs.Count() > 0)
    {
        <div class="boxed">
            <h3>
                由"<span>@Model.Neword</span>"搜索到的主料</h3>
            <div>
                @foreach (var lnk in Model.Mjs)
                {
                    <div class="majoraw">
                        @Ajax.ActionLink(lnk.Name, "Index", "Seek", new
                   {
                       kword = Model.Neword,
                       mjd = lnk.Mid,
                       mid = default(short)
                   },
                        new AjaxOptions
                        {
                            UpdateTargetId = "recipes",
                            Url = Url.Action("Majorized", "Seek", new
                            {
                                id = lnk.Mid,
                                nm = lnk.Name,
                                nt = lnk.Notes
                            })
                        }, new { @class = "b2y", title = lnk.Notes })
                    </div>
                }
            </div>
        </div>
    }
    @if (Model.Mis.Count() > 0)
    {
        <div class="boxed">
            <h3>
                由"<span>@Model.Neword</span>"搜索到的佐料</h3>
            <div>
                @foreach (var lnk in Model.Mis)
                {
                    <div class="majoraw">
                        @Ajax.ActionLink(lnk.Name, "Index", "Seek", new
                   {
                       kword = Model.Neword,
                       mid = lnk.Mid,
                       mjd = default(short)
                   },
                    new AjaxOptions
                    {
                        UpdateTargetId = "recipes",
                        Url = Url.Action("Minorized", "Seek", new
                        {
                            id = lnk.Mid,
                            nt = lnk.Notes,
                            nm = lnk.Name
                        })
                    }, new { @class = "b2y", title = lnk.Notes })
                    </div>
                }
            </div>
        </div>
    }
    @if (Model.Hhs.Count() > 0)
    {
        <div class="boxed">
            @foreach (var hh in Model.Hhs)
            {
                <h3>
                    由"<span>@Model.Neword</span>"搜索到的： @hh.Name</h3>
                <div>@hh.Notes
                    <ul class="right">
                        @foreach (var rh in hh.Rawithes.Where(r => r.Taboo == false))
                        {
                            <li><span>@rh.Parentitle：</span>@rh.Notes</li>
                        }
                    </ul>
                    <ul class="wrong">
                        @foreach (var rh in hh.Rawithes.Where(r => r.Taboo == true))
                        {
                            <li><span>@rh.Parentitle：</span>@rh.Notes</li>
                        }
                    </ul>
                </div>
            }
        </div>
    }
    <div class="boxed">
        <h3>
            平衡膳食
        </h3>
        <div>
            膳食中所含的营养素应种类齐全、数量充足、比例适当；膳食中所供给的营养素与肌体的需要应保持平衡。
        </div>
    </div>
}
